#include "tabs.h"
#include "ui_tabs.h"

tabs::tabs(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::tabs)
{
    ui->setupUi(this);
}

tabs::~tabs()
{
    delete ui;
}

void tabs::setData(QString tabName, QString canva_index){
    ui->label_name->setText(tabName);
    ui->label_index->setText(canva_index);

    QIcon *icon = new QIcon;
    icon->addFile(tr(":/ui/ui_sign/close_canva.png"));
    ui->toolButton->setIcon(*icon);
}

void tabs::on_toolButton_clicked(){
    int canva_index = ui->label_index->text().toInt();
    emit canva_to_close(canva_index);
}
